package gof.com.yew.observer;

public class ObserverDemo {
	
	public static void main(String[] args) {
		ConcreteSubject subject = new ConcreteSubject();
		ObserverA os1 = new ObserverA(subject);
		ObserverA os2 = new ObserverA(subject);
		ObserverA os3 = new ObserverA(subject);
		subject.setState(100);
		System.out.println(os1.getState());
		System.out.println(os2.getState());
		System.out.println(os3.getState());
		System.out.println("----------------------------------------");
		subject.setState(3000);
		System.out.println(os1.getState());
		System.out.println(os2.getState());
		System.out.println(os3.getState());
	}

}
